/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2024-07-08     86188       the first version
 */
#ifndef APPLICATIONS_INC_FILTER_H_
#define APPLICATIONS_INC_FILTER_H_

#include "main.h"
#include "stm32f4xx_hal.h"

typedef struct
{
    float prev_input;
    float prev_input2;
    float input;
    float output;
    float alpha;

}filter_t;


#define LPF_1_(hz,t,in,out) ((out) += ( 1 / ( 1 + 1 / ( (hz) *3.14f *(t) ) ) ) *( (in) - (out) ))


float LowPassFilter(filter_t *f);
float LowPassFilter2(filter_t *f);

float bubbleSort(float arr[], uint8_t n) ;




#endif /* APPLICATIONS_INC_FILTER_H_ */
